﻿Imports DAO
Imports DTO
Public Class MachDieuKhienBUS
    Function themMachDK(ByVal _tenMach As String, ByVal _maLoai As Integer, ByVal _hangSX As String,
                        ByVal _soCongPin As Integer, ByVal _dongDien As Double, ByVal _HSTangThem As Double, ByVal _gia As Integer) As Integer
        Dim dp As New MachDieuKhienDAO
        Return dp.themMachDK(_tenMach, _maLoai, _hangSX, _soCongPin, _dongDien, _HSTangThem, _gia)
    End Function
    Function layMaMachLonNhat() As Integer
        Dim dp As New MachDieuKhienDAO
        Return dp.layMaMachLonNhat()
    End Function
    Function layDSMachDK() As List(Of MachDieuKhienDTO)
        Dim dp As New MachDieuKhienDAO
        Return dp.layDSMachDK()
    End Function

    Function capNhatMachDK(ByVal maMach As Integer, ByVal tenMach As String, ByVal maLoai As Integer,
                           ByVal hangSX As String, ByVal soCongPin As Integer, ByVal hsTangThem As Integer,
                           ByVal dongDien As Integer, ByVal gia As Integer) As Integer
        Dim dp As New MachDieuKhienDAO
        Return dp.capNhatMachDK(maMach, tenMach, maLoai, hangSX, soCongPin, hsTangThem, dongDien, gia)

    End Function

    Function xoaMachDK(ByVal maMach As Integer) As Integer
        Dim dp As New MachDieuKhienDAO
        Return dp.xoaMachDK(maMach)
    End Function

    Function layDSMachDKs(ByVal ids As List(Of Integer)) As List(Of MachDieuKhienDTO)
        Dim dp As New MachDieuKhienDAO
        Return dp.layDSMachDKs(ids)
    End Function

    Function layMachDK(ByVal id As Integer) As MachDieuKhienDTO
        Dim dp As New MachDieuKhienDAO
        Return dp.layMachDK(id)
    End Function

    Function timKiemNC(ByVal p1 As String, ByVal p2 As Object, ByVal p3 As String) As List(Of MachDieuKhienDTO)
        Dim dp As New MachDieuKhienDAO
        Return dp.timKiemNC(p1, p2, p3)
    End Function

End Class
